(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     12771,        449]
NotebookOptionsPosition[      9294,        346]
NotebookOutlinePosition[     11557,        405]
CellTagsIndexPosition[     11472,        400]
WindowTitle->FCReplaceD
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {Cell["FEYN CALC SYMBOL", "PacletNameCell"], Cell[TextData[Cell[BoxData[
     ActionMenuBox[
      FrameBox[
       InterpretationBox[Cell[TextData[{
         "URL",
         StyleBox[" \[FilledDownTriangle]", "AnchorBarArrow",
          StripOnInput->False]
        }]],
        TextCell[
         Row[{"URL", 
           Style[" \[FilledDownTriangle]", "AnchorBarArrow"]}]]],
       StripOnInput->False], {"\<\"FeynCalc/ref/FCReplaceD\"\>":>
      None, "\<\"Copy Wolfram Documentation Center URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell["FeynCalc/ref/FCReplaceD"]}, Visible -> False]]; 
       SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; Null], 
      Delimiter, "\<\"Copy web URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell[
             BoxData[
              MakeBoxes[
               Hyperlink[
               "http://reference.wolfram.com/language/FeynCalc/ref/FCReplaceD.\
html"], StandardForm]], "Input", TextClipboardType -> "PlainText"]}, Visible -> 
           False]]; SelectionMove[
        DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; 
       Null], "\<\"Go to web URL\"\>":>FrontEndExecute[{
        NotebookLocate[{
          URL[
           StringJoin[
            If[
             TrueQ[DocumentationBuild`Make`Private`wsmlinkQ$122891], 
             "http://reference.wolfram.com/system-modeler/", 
             "http://reference.wolfram.com/language/"], 
            "FeynCalc/ref/FCReplaceD", ".html"]], None}]}]},
      Appearance->None,
      MenuAppearance->Automatic,
      MenuStyle->"URLMenu"]],
     LineSpacing->{1.4, 0}]], "AnchorBar"]}
  }]], "AnchorBarGrid",
 GridBoxOptions->{GridBoxItemSize->{"Columns" -> {
     Scaled[0.65], {
      Scaled[0.34]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}}},
 CellID->1],

Cell[TextData[{
 Cell["FCReplaceD", "ObjectName"],
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{8, 0}],
    CacheGraphics->False],
   Spacer[8]]]],
 Cell[BoxData[""], "ObjectNameTranslation"]
}], "ObjectNameGrid"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{"FCReplaceD", "[", 
       RowBox[{"expr", ",", "rule"}], "]"}]], "InlineFormula"],
     " \[LineSeparator]replaces D in expr accoding to the supplied \
replacement rule (e.g. D -> 4 - 2*Epsilon) but doesn't touch D inside Pairs \
and DiracGammas, i.e the dimension of scalar products, metric tensors and \
dirac matrices is unchanged. The latter can and should be done via \
ChangeDimension."
    }]]}
  }]], "Usage",
 GridBoxOptions->{
 GridBoxBackground->{
  "Columns" -> {{None}}, "ColumnsIndexed" -> {}, "Rows" -> {{None}}, 
   "RowsIndexed" -> {}}},
 CellID->982511436],

Cell[CellGroupData[{

Cell[TextData[Cell[BoxData[
 ButtonBox[Cell[TextData[{
   Cell[BoxData[
    InterpretationBox[
     StyleBox[
      GraphicsBox[{},
       BaselinePosition->Baseline,
       ImageSize->{6, 0}],
      CacheGraphics->False],
     Spacer[6]]]],
   "Details"
  }], "NotesFrameText"],
  Appearance->{Automatic, None},
  BaseStyle->None,
  ButtonFunction:>(FrontEndExecute[{
     FrontEnd`SelectionMove[
      FrontEnd`SelectedNotebook[], All, ButtonCell], 
     FrontEndToken["OpenCloseGroup"], 
     FrontEnd`SelectionMove[
      FrontEnd`SelectedNotebook[], After, CellContents]}]& ),
  Evaluator->None,
  Method->"Preemptive"]]]], "NotesSection",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->2032965453],

Cell["", "SectionHeaderSpacer"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Options", "[", "FCReplaceD", "]"}]], "Input",
 CellLabel->"In[61]:="],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{
    RowBox[{"FeynCalcExternal", "\[Rule]", "False"}], ",", 
    RowBox[{"FeynCalcInternal", "\[Rule]", "False"}], ",", 
    RowBox[{"FCVerbose", "\[Rule]", "False"}]}], "}"}], 
  TraditionalForm]], "Output",
 ImageSize->{440, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[61]="]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{6, 0}],
    CacheGraphics->False],
   Spacer[6]]]],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CellTags->"PrimaryExamplesSection",
 CellID->1824880718],

Cell[CellGroupData[{

Cell[TextData[{
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CellID->1092603079],

Cell["\<\
Applying the replacement rule directly to the expression doesn't give the \
desired result\
\>", "Notes"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"FCI", "[", 
  RowBox[{"D", " ", 
   RowBox[{"MTD", "[", 
    RowBox[{"\[Mu]", ",", "\[Nu]"}], "]"}]}], "]"}]], "Input",
 CellLabel->"In[1]:=",
 CellID->1718131501],

Cell[BoxData[
 FormBox[
  RowBox[{"D", " ", 
   SuperscriptBox["g", 
    RowBox[{
     FormBox[
      FormBox["\[Mu]",
       TraditionalForm],
      TraditionalForm], 
     FormBox[
      FormBox["\[Nu]",
       TraditionalForm],
      TraditionalForm]}]]}], TraditionalForm]], "Output",
 ImageSize->{53, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[1]="]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"%", "/.", 
  RowBox[{"D", "\[Rule]", 
   RowBox[{"4", "-", 
    RowBox[{"2", "Epsilon"}]}]}]}]], "Input",
 CellLabel->"In[2]:="],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"(", 
    RowBox[{"4", "-", 
     RowBox[{"2", " ", 
      TagBox["\[CurlyEpsilon]",
       TraditionalForm]}]}], ")"}], " ", 
   SuperscriptBox[
    SubscriptBox["g", 
     FormBox[
      RowBox[{"{", 
       RowBox[{
        RowBox[{"4", "-", 
         RowBox[{"2", " ", 
          TagBox["\[CurlyEpsilon]",
           TraditionalForm]}]}], ",", 
        RowBox[{"4", "-", 
         RowBox[{"2", " ", 
          TagBox["\[CurlyEpsilon]",
           TraditionalForm]}]}]}], "}"}],
      TraditionalForm]], 
    RowBox[{
     FormBox[
      FormBox["\[Mu]",
       TraditionalForm],
      TraditionalForm], 
     FormBox[
      FormBox["\[Nu]",
       TraditionalForm],
      TraditionalForm]}]]}], TraditionalForm]], "Output",
 ImageSize->{171, 19},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[2]="]
}, Open  ]],

Cell["With FCReplaceD we get what we want", "Notes"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"FCReplaceD", "[", 
  RowBox[{
   RowBox[{"D", " ", 
    RowBox[{"MTD", "[", 
     RowBox[{"\[Mu]", ",", "\[Nu]"}], "]"}]}], ",", 
   RowBox[{"D", "\[Rule]", 
    RowBox[{"4", "-", 
     RowBox[{"2", "Epsilon"}]}]}]}], "]"}]], "Input",
 CellLabel->"In[3]:=",
 CellID->1500698710],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"(", 
    RowBox[{"4", "-", 
     RowBox[{"2", " ", 
      TagBox["\[CurlyEpsilon]",
       TraditionalForm]}]}], ")"}], " ", 
   SuperscriptBox["g", 
    RowBox[{
     FormBox[
      FormBox["\[Mu]",
       TraditionalForm],
      TraditionalForm], 
     FormBox[
      FormBox["\[Nu]",
       TraditionalForm],
      TraditionalForm]}]]}], TraditionalForm]], "Output",
 ImageSize->{96, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[3]="]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ChangeDimension", "[", 
  RowBox[{"%", ",", "4"}], "]"}]], "Input",
 CellLabel->"In[4]:="],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"(", 
    RowBox[{"4", "-", 
     RowBox[{"2", " ", 
      TagBox["\[CurlyEpsilon]",
       TraditionalForm]}]}], ")"}], " ", 
   SuperscriptBox[
    OverscriptBox["g", "_"], 
    RowBox[{
     FormBox[
      FormBox["\[Mu]",
       TraditionalForm],
      TraditionalForm], 
     FormBox[
      FormBox["\[Nu]",
       TraditionalForm],
      TraditionalForm]}]]}], TraditionalForm]], "Output",
 ImageSize->{98, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[4]="]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[" ", "FooterCell"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{725, 750},
WindowMargins->{{-10, Automatic}, {Automatic, -8}},
WindowTitle->"FCReplaceD",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "SymbolColor", "LinkTrails" -> 
  GridBox[{{
      RowBox[{
        ButtonBox[
        "FeynCalc", ButtonData -> "paclet:FeynCalc/guide/FeynCalc", 
         BaseStyle -> {"Link", "DockedLinkTrail"}]}]}}, ColumnAlignments -> 
    Left], "HasOptions" -> False, "ExampleCounter" -> 1, "NeedPlatMsgIn" -> 
  None, "RootCaptions" -> "", 
  "Metadata" -> {
   "built" -> "{2020, 6, 20, 19, 6, 14.683519}", 
    "history" -> {"9.0", "", "", ""}, "context" -> "FeynCalc`", 
    "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Feyn Calc Symbol", "language" -> "en", "paclet" -> "FeynCalc", "status" -> 
    "None", "summary" -> 
    "FCReplaceD[expr, rule] replaces D in expr accoding to the supplied \
replacement rule (e.g. D -> 4 - 2*Epsilon) but doesn't touch D inside Pairs \
and DiracGammas, i.e the dimension of scalar products, metric tensors and \
dirac matrices is unchanged. The latter can and should be done via \
ChangeDimension.", "synonyms" -> {}, "tabletags" -> {}, "title" -> 
    "FCReplaceD", "titlemodifier" -> "", "windowtitle" -> "FCReplaceD", 
    "type" -> "Symbol", "uri" -> "FeynCalc/ref/FCReplaceD"}, 
  "SearchTextTranslated" -> ""},
CellContext->"Global`",
FrontEndVersion->"10.4 for Linux x86 (64-bit) (April 11, 2016)",
StyleDefinitions->Notebook[{
   Cell[
    StyleData[
    StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb"]]], 
   Cell[
    StyleData["Input"], CellContext -> "Global`"], 
   Cell[
    StyleData["Output"], CellContext -> "Global`"]}, Visible -> False, 
  FrontEndVersion -> "10.4 for Linux x86 (64-bit) (April 11, 2016)", 
  StyleDefinitions -> "Default.nb"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "PrimaryExamplesSection"->{
  Cell[5184, 163, 388, 15, 31, "PrimaryExamplesSection",
   CellTags->"PrimaryExamplesSection",
   CellID->1824880718]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"PrimaryExamplesSection", 11328, 393}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[582, 21, 2281, 53, 53, "AnchorBarGrid",
 CellID->1],
Cell[2866, 76, 287, 11, 45, "ObjectNameGrid"],
Cell[CellGroupData[{
Cell[3178, 91, 655, 16, 119, "Usage",
 CellID->982511436],
Cell[CellGroupData[{
Cell[3858, 111, 739, 24, 31, "NotesSection",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->2032965453],
Cell[4600, 137, 31, 0, 70, "SectionHeaderSpacer"],
Cell[CellGroupData[{
Cell[4656, 141, 93, 2, 70, "Input"],
Cell[4752, 145, 371, 11, 37, "Output"]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[5184, 163, 388, 15, 31, "PrimaryExamplesSection",
 CellTags->"PrimaryExamplesSection",
 CellID->1824880718],
Cell[CellGroupData[{
Cell[5597, 182, 196, 6, 26, "ExampleSection",
 CellID->1092603079],
Cell[5796, 190, 115, 3, 32, "Notes"],
Cell[CellGroupData[{
Cell[5936, 197, 187, 6, 27, "Input",
 CellID->1718131501],
Cell[6126, 205, 398, 16, 37, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6561, 226, 152, 5, 27, "Input"],
Cell[6716, 233, 884, 34, 40, "Output"]
}, Open  ]],
Cell[7615, 270, 52, 0, 32, "Notes"],
Cell[CellGroupData[{
Cell[7692, 274, 302, 10, 27, "Input",
 CellID->1500698710],
Cell[7997, 286, 526, 21, 37, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[8560, 312, 114, 3, 27, "Input"],
Cell[8677, 317, 551, 22, 37, "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[9267, 344, 23, 0, 41, "FooterCell"]
}
]
*)

(* End of internal cache information *)

